﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SPMS.Commons.Configuration
{
    /// <summary>
    /// 配置工厂接口
    /// </summary>
    /// <remarks>用于创建配置对象</remarks>
    /// <history>
    /// [zanezeng]               2010/1/15 11:18    创建
    /// </history>
    public interface IConfigurationFactory
    {
        /// <summary>
        /// 将给定统一资源描述符（<see cref="Uri"/>）指定的资源加载为配置对象
        /// </summary>
        /// <param name="resource">通过统一资源描述符（<see cref="Uri"/>）指定的配置资源</param>
        /// <returns>加载了给定资源的配置对象</returns>
        /// <remarks></remarks>
        /// <exception cref="ArgumentNullException"><paramref name="resource"/>为<c>null</c>引用。</exception>
        /// <history>
        /// [zanezeng]               2010/1/15 11:18    创建
        /// </history>
        IConfiguration Load( Uri resource );

        /// <summary>
        /// 将给定文件名称指定的资源加载为配置对象
        /// </summary>
        /// <param name="fileName">包含配置资源的文件名称</param>
        /// <returns>加载了给定资源的配置对象</returns>
        /// <remarks></remarks>
        /// <exception cref="ArgumentNullException"><paramref name="fileName"/>为<c>null</c>引用或者为空字符串。</exception>
        /// <history>
        /// [zanezeng]               2010/1/15 11:18    创建
        /// </history>
        IConfiguration Load( string fileName );

        /// <summary>
        /// 将给定文件资源对象中加载为配置对象
        /// </summary>
        /// <param name="resource">包含配置信息的资源对象</param>
        /// <returns>加载了给定资源的配置对象</returns>
        /// <remarks></remarks>
        /// <exception cref="ArgumentNullException"><paramref name="resource"/>为<c>null</c>引用。</exception>
        /// <history>
        /// [zanezeng]               2010/1/15 12:07    创建
        /// </history>
        IConfiguration Load( object resource );
    }
}
